package com.gopay.common.cipher.vo;

import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;

public class SecurityInfoKeyBox implements Serializable{

	private static final long serialVersionUID = 1L;

	private SecurityKeyInfo currentKeyInfo;
	
	private Map<String, SecurityKeyInfo> allKeyInfos;

	public  SecurityKeyInfo getCurrentKeyInfo() {
		return currentKeyInfo;
	}

	public void setCurrentKeyInfo(SecurityKeyInfo currentKeyInfo) {
		this.currentKeyInfo = currentKeyInfo.clone();
	}

	public Map<String, SecurityKeyInfo> getAllKeyInfos() {
		return allKeyInfos;
	}

	public void setAllKeyInfos(Map<String, SecurityKeyInfo> allKeyInfos) {
		if(this.allKeyInfos == null || this.allKeyInfos.size() == 0) {
			this.allKeyInfos = new HashMap<String, SecurityKeyInfo>();
			this.allKeyInfos.putAll(allKeyInfos);
		} else {
			this.allKeyInfos.clear();
			this.allKeyInfos.putAll(allKeyInfos);
		}
		//this.allKeyInfos.putAll(allKeyInfos);
	}
	
}
